package org.stars.dao.sqlmapper.typealias;

import org.stars.config.Config;
import org.stars.dao.config.DaoConfig;

public abstract class TypeAliasUtils {

	public static Class<?> resolveClass(String name) throws Exception {
		DaoConfig daoConfig = Config.getDaoConfig();
		Class<?> result = null;
		// try to instanziate simple name
		try {
			result = Class.forName(name);
		} catch (Exception e) {

		}
		if (result == null) {
			try {
				result = Class.forName(daoConfig.getTypeAliasMap().get(name)
						.getClassName());
			} catch (Exception e) {
				
				throw (e);
			}
		}

		return result;
	}
}
